﻿using System;

namespace Needle.Core.Factory
{
    /// <summary>
    /// Uses System.Activator to create instances.
    /// </summary>
    public class SystemActivatorFactory : FactoryBase
    {
        /// <summary></summary>
        public SystemActivatorFactory(Type producedType)
        :base (producedType){

        }
        /// <summary>
        /// Calls System.Activator.CreateInstance(t, args)
        /// </summary>
        public override object CreateInstance(params object[] args)
        {
            return System.Activator.CreateInstance(ProducedType, args);
        }
    }
}
